import React, {Component} from 'react';
import { View } from 'react-native';

import { Selection } from 'iftide';

export default class Basic extends Component {
    constructor(props) {
        super(props);
        this.comboBox = null;
        this.state={
            value:null
        }
    }

    _showComboBox() {
        this.comboBox._onPress();
    }

    changeFunc = (text,value) => {
        console.log(text);
        console.log(value);
    }

    okFunc = (text,value) => {
        console.log(text);
        console.log(value);
        this.setState({
            value:text
        })
    }

    render() {
        return (
            <View>
                <Selection
                    value={this.state.value}
                    title = '标题文字'
                    placeHolder = '请选择'
                    hasTopBorder = {true}
                    onPress = {()=>this._showComboBox()}
                />
                 <Selection
                    value={this.state.value}
                    title = '标题文字'
                    placeHolder = '请选择'
                    hasTopBorder = {true}
                    onPress = {()=>this._showComboBox()}
                    titleIconFunc={() => { alert(1) }}
                    titleIcon={require('./sicon.png')} 
                />
            </View>
        );
    }
}
